#include "RedNeuronal.h"
#include <stdio.h>
using namespace std;

int main() {
	RedNeuronal rN(2, 1);

	rN.AgregarCapaNeuronal(20);

	vector<double> a;
	vector<double> b;
	vector<double> c;
	vector<double> d;
	vector<double> tarA;
	vector<double> tarB;
	vector<double> output;

	vector<vector<double> > inputs, targets;

	// [0,0]
	a.push_back(0);
	a.push_back(0);
	// [1,1]
	b.push_back(1);
	b.push_back(1);
	// [1,0]
	c.push_back(1);
	c.push_back(0);
	// [0,1]
	d.push_back(0);
	d.push_back(1);

	inputs.push_back(a);
	inputs.push_back(b);
	inputs.push_back(c);
	inputs.push_back(d);

	tarA.push_back(0);
	tarB.push_back(1);

	targets.push_back(tarA);
	targets.push_back(tarA);
	targets.push_back(tarB);
	targets.push_back(tarB);

	rN.Entrenar(inputs, targets);

	output = rN.Pensar(a);
	printf("Resultado: ( %f )\n", output.at(0));

	output = rN.Pensar(b);
	printf("Resultado: ( %f )\n", output.at(0));

	output = rN.Pensar(c);
	printf("Resultado: ( %f )\n", output.at(0));

	output = rN.Pensar(d);
	printf("Resultado: ( %f )\n", output.at(0));

	return 0;
}
